package com.it;

import com.it.bean.R;
import com.it.pojo.Type;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("type")
public class TypeController {

    @Resource
    private TypeService typeService;

    @GetMapping("list")
    public R<?> listTypes() {
        List<Type> typeList = typeService.listTypes();
        return R.success("成功", typeList);
    }

}
